if (this.load) {
	load("../src/includes.js");
}

DataCenterConf = {
	racks: [
		{name: 'r1'},
		{name: 'r2'}
	],
	switches: [
		{name: 'sw1', ports: 10, speed: 100e6, connect: ['sw2']},
		{name: 'sw2', ports: 10, speed: 100e6, connect: ['sw1']}
	],
	hosts: [
		{name: 'host1', disk: 'disk1', connect: 'sw1', rack: 'r1', apps: ['namenode']},
		{name: 'host2', disk: 'disk1', connect: 'sw1', rack: 'r1', apps: ['datanode']},
		{name: 'host3', disk: 'disk1', connect: 'sw1', rack: 'r1', apps: ['datanode']},
		{name: 'host4', disk: 'disk1', connect: 'sw1', rack: 'r1', apps: ['hdfsclient']}
		],
	disks: [
       {
    	   name: 'disk1',
    	   capacity: 100e9,
    	   used: 4e9,
    	   accessTime: 0.001,
    	   readThput: 100e6,
    	   writeThput: 100e6,
    	   nDisks: 1
        }
	]
};

var dc = new DataCenter();
dc.load(DataCenterConf);

dc.sim.setLogger(print);
dc.sim.simulate(100);
dc.getApplication('host1', 'namenode').report(print);

